package com.yunmang.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.yunmang.R;

/**
 * Created by Administrator on 2017/5/18.
 */
public class WarningDialog extends Dialog {
    private ImageView img_back;// 关闭
    private TextView content_text;
    private Button btn_close;
    private Context context;
    public WarningDialog(Context context) {
        super(context);

    }

    public WarningDialog(Context context, int theme) {
        super(context, theme);
        this.context=context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.custom_dialog);
        this.setCancelable(false);
        content_text = (TextView) findViewById(R.id.title_text);
        btn_close=(Button) findViewById(R.id.button);
        content_text.setText("存在漏扫，不能上传");
        img_back = (ImageView) findViewById(R.id.img_back);
        img_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 关闭dialog
                if (isShowing()) {
                    dismiss();
                }
            }
        });
        btn_close.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // 关闭dialog
                if (isShowing()) {
                    dismiss();
                }
            }
        });
    }
}
